﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace GC_School_of_Careers
{

    
    public partial class LoginScreen : Form
    {
        public LoginScreen()
        {
            InitializeComponent();
        }

        private void blogin_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < (this.dgvusers.Rows.Count - 1); ++i)
            {
                if ((Convert.ToString(dgvusers.Rows[i].Cells[0].Value) == txtusername.Text) & (Convert.ToString(dgvusers.Rows[i].Cells[1].Value) == txtpassword.Text))
                {
//                    this.groupLoginScreen.Visible = false;
                    MessageBox.Show("Login Succesfull");
                    this.Dispose(false);
                    GlobalClass.GlobalVar = "1";
                }
                else
                {
                    MessageBox.Show("User or Password incorrect");
                    GlobalClass.GlobalVar = "0";
                }
            }
        }

        private void LoginScreen_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dsuser.TALUSER' table. You can move, or remove it, as needed.
            this.tALUSERTableAdapter.Fill(this.dsuser.TALUSER);

        }

    }
}
